跳到主要内容

Qwen Code

Qwen Code 是 Qwen 的开源命令行 AI 编码工作流工具。 官方网站:qwen.ai/qwencode

1.1 使用方法

方式一:配置文件

在 shell 中设置您的 Luchentech 密钥:

export HPC_AI_API_KEY="your-luchentech-key"

配置 ~/.qwen/settings.json

{
"modelProviders": {
"openai": [
{
"id": "minimax/minimax-m2.5",
"name": "Luchentech Minimax M2.5",
"envKey": "HPC_AI_API_KEY",
"baseUrl": "https://api.luchentech.com/inference/v1",
"generationConfig": {
"timeout": 120000,
"maxRetries": 2,
"samplingParams": {
"temperature": 0.2,
"max_tokens": 8192
}
}
}
]
},
"security": {
"auth": {
"selectedType": "openai"
}
},
"model": {
"name": "minimax/minimax-m2.5"
}
}

然后启动 Qwen Code:

qwen

方式二:运行时参数

在编写持久配置之前使用运行时参数进行快速测试:

export HPC_AI_API_KEY="your-luchentech-key"

qwen --auth-type openai \
--model minimax/minimax-m2.5 \
--openaiApiKey "$HPC_AI_API_KEY" \
--openaiBaseUrl https://api.luchentech.com/inference/v1

1.2 参考